package sessionTracking;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

public class PrintSessionAttribute extends HttpServlet
{
    public void doGet(HttpServletRequest req,HttpServletResponse res)throws ServletException,IOException
    {
    PrintWriter pw=res.getWriter();

    HttpSession ses=req.getSession();
    String st=(String)ses.getAttribute("uname");

    pw.println("<h1> Hai "+st+"</h1>");
    }
}